/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;

/**
 *
 * @author Daniel
 */

@Entity

public class MedicalRecord implements Serializable {
    
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;
    
    @OneToMany(mappedBy = "medicalrecord")
    private List<Appointment> appointments;
    @OneToOne(mappedBy = "medicalrecord")
    private Pet pet;
    @OneToMany(mappedBy = "medicalrecord")
    private List<Vacine> vacines;

    public MedicalRecord() {
    }
    
    public MedicalRecord(Pet pet){
        this.appointments = null;
        this.pet = pet;
        this.vacines = null;
    }

    /**
     * @return the id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return the appointments
     */
    public List<Appointment> getAppointments() {
        return appointments;
    }

    /**
     * @param appointments the appointments to set
     */
    public void setAppointments(List<Appointment> appointments) {
        this.appointments = appointments;
    }

    /**
     * @return the pet
     */
    public Pet getPet() {
        return pet;
    }

    /**
     * @param pet the pet to set
     */
    public void setPet(Pet pet) {
        this.pet = pet;
    }

    /**
     * @return the vacines
     */
    public List<Vacine> getVacines() {
        return vacines;
    }

    /**
     * @param vacines the vacines to set
     */
    public void setVacines(List<Vacine> vacines) {
        this.vacines = vacines;
    }

    
}
